from flask import blueprints, jsonify, request
from ..models.user_mapper import UserMapper

user_controller = blueprints.Blueprint('user', __name__)
user_mapper = UserMapper()


@user_controller.route('login', methods=['POST'])
def get_user():
    return jsonify({
        'name': 'John Doe',
        'email': 'john.doe@example.com',
        'phone': '+1 555-555-5555',
        'address': '123 Main St, Anytown, CA 12345',
        'bio': 'I am a software engineer who loves to code.',
        'interests': ['coding', 'gaming', 'travel'],
        'skills': ['Python', 'Java', 'C++'],
        'experience': []
    })

@user_controller.route('add', methods=['POST'])
def add_user():
    print(request.json)
    user = user_mapper.add_user(request.json['name'],request.json['password'], request.json['age'])
    return jsonify(user.to_dict())
